//
//  DebugManagerUtil.m
//  YK_DebugManager
//
//  Created by edward on 2021/6/4.
//

#import "DebugManagerUtil.h"
#import "UIView+DebugManager.h"

@implementation DebugManagerUtil

static DebugManagerUtil *_instance;

+ (id)allocWithZone:(struct _NSZone *)zone
{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        _instance = [super allocWithZone:zone];
    });
    
    return _instance;
}

+ (instancetype)sharedInstance
{
    if (_instance == nil) {
        _instance = [[DebugManagerUtil alloc] init];
    }
    
    return _instance;
}

- (void)setDebug_borderShow:(BOOL)debug_borderShow
{
    _debug_borderShow = debug_borderShow;
    
    if ([UIApplication sharedApplication].windows.count > 0 ) {
        for (UIWindow *window in [UIApplication sharedApplication].windows) {
            [window debug_MetricsRecursiveEnable:debug_borderShow];
        }
    }else {
        
    }
    
}

@end
